<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>给组件绑定原生事件</title>
  <script src="./vue.js"></script>
</head>
<body>
  <div id="root">
    <!-- 正常情况下父组件上的@click是自定义事件 -->
    <!-- 通过后面后缀 .native将事件变为原生事件，直接通过父组件触发 -->
    <child @click.native="handleClick"></child>
  </div>

  <script>
    Vue.component('child', {
      template: '<div>组件绑定原生事件，事件名后缀.native</div>'
    })
    var vm = new Vue({
      el: '#root',
      methods: {
        handleClick: function() {
          alert('click')
        }
      }
    })
  </script>
</body>
</html>